The present invention generally pertains to an electronic compass for a vehicle, and more particularly pertains to electronic compasses having improved data filtering and/or heading determination.
Electronic compasses have become increasingly popular as an accessory in automobiles. The general construction of a typical electronic compass circuit 10 is shown in FIG. 1. Specifically, a typical electronic compass circuit includes a magnetic sensor circuit 12, which includes a Y-axis sensor 13 and an X-axis sensor 14. Magnetic sensor circuit 12 is coupled to a processing circuit 15, which operates under control of software code to process the data supplied by sensor circuit 12, calibrate the compass circuit based upon such processing, and to determine the heading of the vehicle based upon the data provided by sensor circuit 12. Processing circuit 15 is coupled to a non-volatile memory 16, which stores calibration data so that the compass does not need to be recalibrated each ignition cycle. The calibrated vehicle heading is sent from processing circuit 15 to a heading display 18 for display to the vehicle occupants. The heading display is typically incorporated in an overhead console or rearview mirror assembly. User input switches 20 may also be provided that enable a user to interact with processing circuit 15 so as to cause processing circuit 15 to change the information displayed on display 18, manually recalibrate, and/or enter the geographic zone in which the vehicle is currently traveling. Additionally, a power supply circuit 22 is provided for receiving the 12-volt power from the vehicle's battery or ignition, and converts the power to power levels useful for the various components of the compass circuit 10.
In this prior art system, the Y-axis sensor 13 is provided to sense magnetic fields perpendicular to the vehicle's direction of travel, while the X-axis sensor 14 is provided to sense magnetic fields in line with the vehicle's direction of travel. Both sensors 13 and 14 are typically mounted parallel to the Earth's surface. With such a mounting, if no magnetic field component is sensed by the Y-axis sensor 13, and a positive magnetic field component is sensed by X-axis sensor 14, processing circuit 15 would determine that the vehicle is headed north. Similarly, if no magnetic field component is sensed by the Y-axis sensor and a negative magnetic field component is sensed by the X-axis sensor, processing circuit 15 would determine that the vehicle is headed south. Likewise, if no magnetic field component is sensed by the X-axis sensor and a positive magnetic component is sensed by the Y-axis sensor, processing circuit 15 would determine that the vehicle is headed east. If no magnetic field component is sensed by the X-axis sensor and a negative magnetic field component is sensed by the Y-axis sensor, processing circuit 15 would determine that the vehicle is headed west. If equal positive magnetic field components are sensed by both the X- and Y-axis sensors, the processing circuit would determine if the vehicle is heading northeast. If equal negative magnetic field components are sensed by both the X- and Y-axis sensors, the processing circuit would determine that the vehicle is headed southwest. If a positive magnetic field component is sensed by the X-axis sensor that is equal to the absolute value of a negative magnetic field component sensed by the Y-axis sensor, the processing circuit would determine if the vehicle is heading northwest. If the absolute value of a negative magnetic field component that is sensed by the X-axis sensor is equal to the value of a positive magnetic field component sensed by the Y-axis sensor, the processing circuit would determine that the vehicle is headed southeast. Under ideal circumstances, if the output levels of the magnetic sensors were plotted relative to the X and Y axes as the vehicle turned through a 360° loop, the plot would form a circle, as depicted as circle A in FIG. 2.
Because such electronic compasses generally only display eight different headings (N, NE, E, SE, S, SW, W, and NW) and because the magnetic field components sensed by the X- and Y-axis sensors are not always zero and are not always equal, the compass processing circuit generally computes a heading angle φ relative to the X and Y axis, and compares this heading angle to angle thresholds that define the boundaries between each of the eight different heading displays. Thus, the circular plot A, as shown in FIG. 2, is effectively split into eight angular segments of 45° corresponding to the eight different display headings. The compass processing circuit thus simply determines in which segment the heading angle φ lies to determine which of the eight headings to display.
As stated above, an ideal circumstance would be when the output levels of the X- and Y-axis sensors 13 and 14 form a circular plot A relative to the X- and Y-axis sensors with the center of the perfect circle at the origin of the coordinate system. In practice, however, the plot of the outputs of the X and Y sensors on an X and Y coordinate plane often does not form a perfect circle, nor is the center of such a circle coincident with the origin of the coordinate plane. Specifically, the plot may be somewhat elliptical and offset in both the X and Y directions from the origin as depicted by plot B in FIG. 2. When the actual plot is not a perfect circle and has a center point offset from the origin, the processing circuit cannot use a simple heading angle calculation to determine the appropriate heading. Such shifts and distortion of the circular plot are typically caused by the effect of the ferrous materials in the vehicle that may alter the magnetic field as sensed by the X- and Y-axis sensors. To enable ease of heading computation, the compass circuit is calibrated to account for the effects of the vehicle on the sensed magnetic field.
Not only must a compass circuit be initially calibrated, but it must continuously be recalibrated due to the fact that the influence on the magnetic field caused by the ferrous materials in the vehicle changes over time and due to external influences on the magnetic field that may only be temporary. For example, the addition of a roof-mounted antenna may cause a fluctuation in the magnetic field readings as may passing by an object with a large amount of ferrous material, such as railroad tracks, bridges, and large buildings or when the vehicle moves through a car wash. Accordingly, calibration and continuous recalibration of electronic compass circuits have received much attention.
In U.S. Pat. No. 4,953,305 issued to Van Lente et al., an electronic compass system is described having automatic continuous calibration. This patent discloses a calibration technique whereby data from the sensors is accumulated as the vehicle travels through numerous 360° loops, and is translated into data points on an X-Y coordinate plane. The processing circuit determines the maximum value of the accumulated data along the Y axis (Ymax), the minimum value along the Y axis (Ymin), the maximum value along the X axis (Xmax), and the minimum value along the X axis (Xmin). From the maximum and minimum values along the X axis, the span along the X axis may be computed between Xmin and Xmax. Similarly, from the maximum and minimum values along the Y axis, the span along the Y axis between Ymin and Ymax may be computed. If these spans are not equal, the processing circuit may adjust the gain of one or both of the X- and Y-axis sensors until such time that the spans are equal to one another. This process is carried out to convert any elliptical plot of data into a circular plot of data prior to further processing. Subsequently, the maximum and minimum values from the X and Y sensors are utilized to calculate a center point (XE, YE) of the plot B (see FIG. 2). X and Y error values (XE and YE) are then computed and subsequently utilized to offset each data point as it is received from the X and Y sensors, respectively. Once the compass has initially calibrated, it continues to automatically recalibrate based upon the maximum and minimum values subsequently accumulated along the X and Y axes.
One problem with the automatic calibration routine disclosed in the above-noted '305 patent is that it generally requires that the vehicle travel in numerous 360° loops to attain sufficient data for the system to have confidence that the calibration is accurate. This poses a problem to vehicle manufacturers who must then drive each vehicle through several loops before loading the vehicle on a vehicle carrier for delivery to a dealer. Unfortunately, there often is not sufficient space at the assembly plant for each vehicle to be driven in such loops and, even if there is space, the process takes precious time. If the vehicles are delivered to the dealership without having been driven through sufficient loops, a customer may purchase the vehicle or otherwise test drive the vehicle with an uncalibrated compass. In this event, the customer might erroneously be lead to believe that the compass is malfunctioning and thus make an unnecessary warranty claim with respect to the compass.
Several patents disclose various approaches to the above-noted problem. In U.S. Pat. No. 6,192,315 to Geschke et al., a calibration routine is disclosed whereby a compass is initially calibrated prior to installation in the vehicle based upon expected vehicle magnetism for the particular model in which the compass is being installed. This initial calibration is utilized until such time that the vehicle otherwise acquires enough data by traveling through a number of 360° loops. Once sufficient data is attained, the compass switches to the more recently acquired calibration data and the compass is then continuously recalibrated using the technique in the aforementioned '305 patent.
U.S. Pat. No. 5,737,226 issued to Olson et al. discloses a calibration technique whereby the processing circuit determines whether the raw data obtained from the sensors suggests that the compass is no longer accurately calculated. In which case, the processing circuit obtains two end points spaced apart by more than a predetermined angle using an assumed radius. Using the assumed radius, two potential center points for a circle are presented. The '226 patent discloses obtaining an intermediate data point in between the two end points, which is utilized for identifying which of the two center points to utilize for calibration and to subsequently utilize when determining the vehicle heading.
U.S. Pat. No. 6,301,794 to Parks et al. discloses a calibration routine in which the compass is recalibrated each time three data points are obtained that meet specified criteria. Once three data points are obtained that meet the specified criteria, which includes averaging and spacing criteria, the center of a circle is computed using the equation for a circle such that the circle would necessarily include the three data points.
U.S. Pat. No. 4,807,462 issued to Al-Attar discloses a compass calibration routine, which calibrates the compass based upon acquisition of three points of data. The center of the circle used for calibration is determined by determining the point of intersection of the perpendicular bisectors of the two lines joining the adjacent ones of the three data points.
Although each of the above-noted patents discloses a calibration routine that more quickly calibrates the compass, some of the techniques disclosed are either overactive in that they recalibrate too frequently and thus are prone to calibration errors due to temporary magnetic field disturbances, or they do not respond quickly enough to changes in magnetic field variances that are more permanent in nature. Additionally, each of the above-noted calibration routines computes the center of a circle by assuming that three to four points are disposed exactly about the circumference of the circle. As will be explained in more detail below, it is possible that any one of these points may be offset from the circumference of a circle that would in fact better fit the data obtained. Furthermore, none of the above-noted patents disclose calibration routines that take into account the pitch of the vehicle or the strength of the vertical component of the Earth's magnetic field vector. Accordingly, if any of the above-noted compasses is mounted such that its sensors are provided in a movable structure relative to the vehicle, such as the housing of a rearview mirror assembly, these systems would be incapable of providing a quick and accurate response to movement of the housing.
Commonly assigned U.S. Pat. Nos. 6,023,229 and 6,140,933 issued to Bugno et al. disclose various techniques for mounting compass sensors in a rearview mirror housing, which may be pivoted horizontally and vertically relative to the vehicle in which it is mounted. Specifically, various mechanisms are disclosed for detecting when the mirror housing, and hence the sensors, has been tilted. When tilting of the mirror housing has been detected, a signal is sent to the compass processing circuit indicating that tilting has occurred so that the processing circuit does not otherwise assume that any drastic change occurred in the magnetic field vector. The processing circuit then determines a difference vector between data points obtained just prior to the tilt signal and those obtained just after the tilt signal to utilize for error compensation signal. In the '229 patent, a mechanism is disclosed where a third magnetic sensor aligned in the Z axis is provided. The Z-axis sensor output is utilized to determine whether a tilt has occurred once an abrupt change is first sensed in the X- and Y-sensor outputs. The processing circuit will respond to any such abrupt change in the X- and Y-sensor outputs by either identifying an error vector or by reinitiating calibration, depending on whether an abrupt change was also detected in the Z-axis sensor. This compass system, however, does not utilize the Z-axis sensor for determining the heading or identifying the center of a circle used for calibration.